package org.zjvis.datascience.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;

/**
 * @author AaronY
 * @version 1.0
 * @since 2022/8/24
 */
@Component
public class WebConfig implements WebServerFactoryCustomizer<ConfigurableWebServerFactory> {

    @Value("${app.server.port}")
    private Integer port;

    @Override
    public void customize(ConfigurableWebServerFactory factory) {
        factory.setPort(port);
    }
}